package com.winning.ds.login.config;

import com.winning.ds.login.filter.XSSFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName : FilterConfig
 * @Description : 过滤器配置类
 * @Author : zhanglei
 * @Date : 2019/3/8 10:19
 **/
@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean registFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new XSSFilter());
        registration.addUrlPatterns("*");
        registration.setName("XSSFilter");
        registration.setOrder(1);
        return registration;
    }
}

